package com.hsj.goldstore.base;

import com.hsj.goldstore.utils.retrofit.ApiStore;
import com.hsj.goldstore.utils.retrofit.AppClient;

import org.reactivestreams.Subscriber;

import io.reactivex.CompletableEmitter;
import io.reactivex.CompletableOnSubscribe;
import io.reactivex.Flowable;
import io.reactivex.Observable;
import io.reactivex.Observer;
import io.reactivex.Scheduler;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.CompositeDisposable;
import io.reactivex.disposables.Disposable;
import io.reactivex.internal.subscriptions.ArrayCompositeSubscription;
import io.reactivex.schedulers.Schedulers;

/**
 * Created by Administrator on 2018/3/22.
 */

public class BaseModel {

    public ApiStore apiStore = AppClient.retrofit().create(ApiStore.class);

    
    public void addSubscribe(Observable observable, Observer observer) {

        observable
                .subscribeOn(Schedulers.io())
                .unsubscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(observer);
    }

}
